package com.jinzihan.junit;

import com.jinzihan.entity.Classroom;
import com.jinzihan.entity.Order;
import com.jinzihan.service.OrderService;
import com.jinzihan.service.impl.OrderServiceImpl;
import org.junit.jupiter.api.Test;

import java.sql.Date;
import java.util.List;

class OrderServiceTest {
    OrderService orderService = new OrderServiceImpl();
    @Test
    void createOrder() {
        orderService.createOrder(new Order(null,1,0,new Date(1),11));
        orderService.createOrder(new Order(null,2,0,new Date(1),9));
        orderService.createOrder(new Order(null,3,0,new Date(1),10));
    }

    @Test
    void myOrders() {
        List<Order> orders = orderService.myOrders(2);
        orders.forEach(System.out::println);
    }

    @Test
    void allOrders() {
        List<Order> orders = orderService.allOrders();
        orders.forEach(System.out::println);
    }

    @Test
    void orderDetails() {
        Classroom classroom = orderService.orderDetails(5);
        System.out.println(classroom);
    }

    @Test
    void acceptOrder() {
        orderService.acceptOrder(8);
    }

    @Test
    void refuseOrder() {
        orderService.refuseOrder(8);
    }
}